package com.songlanyun.modules.usergains.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.songlanyun.common.enums.UserBillConstant;
import com.songlanyun.common.streamquery.BaseBatchData;
import com.songlanyun.common.utils.PageUtils;
import com.songlanyun.modules.usergains.entity.UserBill;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;

/**
 * 会员分销所得账单
 *
 * @author wuchao
 * @email sunlightcs@gmail.com
 * @date 2020-12-22 15:21:52
 */
public interface UserBillService extends IService<UserBill> {

    PageUtils queryPage(Map<String, Object> params);

    List<UserBill> list(Long userId);


    /**
     * 保存会员入账账单
     *
     * @param userId
     * @param remark     所得帐单描述
     * @param innerMode  收入模式
     * @param entryValue 入帐的余额
     * @param code       单 号
     */
    void inBill(Long userId, String remark, UserBillConstant.InnerMode innerMode, BigDecimal entryValue, String code,String operator);

    /**
     * 保存会员出账账单
     *
     * @param userId
     * @param remark     所得帐单描述
     * @param outerMode  出账模式
     * @param entryValue 出账的金额
     * @param code       单号
     */
    void outBill(Long userId, String remark, UserBillConstant.OuterMode outerMode, BigDecimal entryValue, String code,String operator);


     void batchProcess(Integer batchSize, Consumer<BaseBatchData> consumer);

    void batchActivationAndAirdrop(BigDecimal allActivationUseCommissionAble , List<?> data);

    PageUtils queryBillPage(Map<String, Object> params);

    void monthlyDirectorDividends(Long userId, BigDecimal personalProperty);

    //订单核销
    void writeOff(Long userId, BigDecimal personalProperty,String orderCode);

    //用户自己增加贡献值
    void inUserBill(Long userId, String orderCode, BigDecimal consumptionValue, UserBillConstant.BillType income, UserBillConstant.InnerMode buyIncome);
}

